#define _GNU_SOURCE
#include <unistd.h>
#include "app_pool.h"
#include <stdio.h>
#include <log/log.h>
#include <stdlib.h>
int func(void* arg){
    log_info("task:%s,tid=%d\n",(char*)arg,gettid());
    free(arg);/*输出结束，释放空间*/
    return 0;
}

int main(int argc, char const *argv[])
{
    char* str;
    app_pool_Init(4);
    /*创建任务，并注册任务*/
    for(int i=0;i<10;i++){
        str=malloc(10);
        sprintf(str,"hello_%d",i);
        app_pool_registerTask(func,(void*)str);
    }
    sleep(1);
    app_pool_close();
    
    return 0;
}
